Optimal. Leaf size=84 \[ \frac {1}{2} (b B+a C) x+\frac {(2 a B+3 b C) \sin (c+d x)}{3 d}+\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a B \cos ^2(c+d x) \sin (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {4157, 4081,
3872, 2715, 8, 2717} \begin {gather*} \frac {(2 a B+3 b C) \sin (c+d x)}{3 d}+\frac {(a C+b B) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {1}{2} x (a C+b B)+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2717
Rule 3872
Rule 4081
Rule 4157
Rubi steps
\begin {align*} \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^3(c+d x) (a+b \sec (c+d x)) (B+C \sec (c+d x)) \, dx\\ &=\frac {a B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) (-3 (b B+a C)-(2 a B+3 b C) \sec (c+d x)) \, dx\\ &=\frac {a B \cos ^2(c+d x) \sin (c+d x)}{3 d}-(-b B-a C) \int \cos ^2(c+d x) \, dx-\frac {1}{3} (-2 a B-3 b C) \int \cos (c+d x) \, dx\\ &=\frac {(2 a B+3 b C) \sin (c+d x)}{3 d}+\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{2} (-b B-a C) \int 1 \, dx\\ &=\frac {1}{2} (b B+a C) x+\frac {(2 a B+3 b C) \sin (c+d x)}{3 d}+\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a B \cos ^2(c+d x) \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 75, normalized size = 0.89 \begin {gather*} \frac {6 b B c+6 a c C+6 b B d x+6 a C d x+3 (3 a B+4 b C) \sin (c+d x)+3 (b B+a C) \sin (2 (c+d x))+a B \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 85, normalized size = 1.01
method | result | size |
derivativedivides | \(\frac {\frac {B a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right ) b}{d}\) | \(85\) |
default | \(\frac {\frac {B a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right ) b}{d}\) | \(85\) |
risch | \(\frac {B b x}{2}+\frac {a x C}{2}+\frac {3 a B \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) C b}{d}+\frac {B a \sin \left (3 d x +3 c \right )}{12 d}+\frac {\sin \left (2 d x +2 c \right ) b B}{4 d}+\frac {\sin \left (2 d x +2 c \right ) a C}{4 d}\) | \(85\) |
norman | \(\frac {\left (\frac {b B}{2}+\frac {a C}{2}\right ) x +\left (-\frac {b B}{2}-\frac {a C}{2}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {b B}{2}-\frac {a C}{2}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {b B}{2}+\frac {a C}{2}\right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 b B -2 a C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (b B +a C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (b B +a C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (2 B a -b B -a C +2 C b \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (2 B a +b B +a C +2 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (2 B a -3 b B -3 a C -6 C b \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 \left (2 B a -3 b B -3 a C +6 C b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {\left (2 B a +3 b B +3 a C -6 C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 \left (2 B a +3 b B +3 a C +6 C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}\) | \(364\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 79, normalized size = 0.94 \begin {gather*} -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b - 12 \, C b \sin \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.38, size = 60, normalized size = 0.71 \begin {gather*} \frac {3 \, {\left (C a + B b\right )} d x + {\left (2 \, B a \cos \left (d x + c\right )^{2} + 4 \, B a + 6 \, C b + 3 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 180 vs.
\(2 (76) = 152\).
time = 0.47, size = 180, normalized size = 2.14 \begin {gather*} \frac {3 \, {\left (C a + B b\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.96, size = 84, normalized size = 1.00 \begin {gather*} \frac {B\,b\,x}{2}+\frac {C\,a\,x}{2}+\frac {3\,B\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {C\,b\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________